import java.util.Scanner;
class UserInput {
	int lastDate;
	private Scanner in = new Scanner(System.in);
	
	int[] getDate(prompt) {
		System.out.println(prompt);
		boolean isDateValid = false;
		String date;
		while(!isDateValid) {
			date = in.nextLine();
			isDateValid = checktDate(date);
		}
	}
	
	private boolean checktDate(String date) {
		date = date.trim();
		String day;
		String month;
		String year;
		//patterns
		Pattern pDay = Pattern.compile("^[1-9][0-9]*");
		Pattern pMonth = Pattern.compile("[a-z]*");
		Pattern pYear = Pattern.compile("[1-9][0-9]{3,}$");
		
		//matchers
		Matcher mDay = pDay.matcher(date);
		Matcher mMonth = .matcher(date);
		Matcher mYear = day.matcher(date);
		
		day = mDay.group();
		month = mMonth.group();
		year = mYear.group();
		
		System.out.println("dayParse:" + day);
		System.out.println("monthParse:" + month);
		System.out.println("yearParse:" + year);
		
	}
}